<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<style type="text/css">
	.jieguo{
		width: 455px;
		height: 60px;
		border: 2px solid #45A89E;
		margin-top: 10px;
	}

	</style>
</head>
<body>
	<form action="" method="post">
		<input type="text" name ='num1'>
		<select name="num2" id="">
			<option value="+">加</option>
			<option value="-">减</option>
			<option value="*">乘</option>
			<option value="/">/除</option>
		</select>
		<input type="text" name ='num3'>
		<input type="submit" value="等于">
	</form>
	<div class="jieguo">
		<?php 
			$num1 = isset($_POST['num1'])? $_POST['num1'] : 0;
			$num2 = isset($_POST['num2'])? $_POST['num2'] : "+";
			$num3 = isset($_POST['num3'])? $_POST['num3'] : 0;
			// var_dump($num1,$num2,$num3);
			switch ($num2) {
				case '+':
					// echo $num1+$num3;
					echo $num1,$num2,$num3,"=",$num1+$num3;
					break;
				case '-':
					// echo  $num1-$num3;
					echo $num1,$num2,$num3,"=",$num1+$num3;
					break;
				case '*':
					// echo  $num1*$num3;
					echo $num1,$num2,$num3,"=",$num1+$num3;
					break;
				case '/':
					// echo  $num1/$num3;
					echo $num1,$num2,$num3,"=",$num1+$num3;
					break;
				default:
					echo "乌拉乌拉德玛西亚！";
					break;
			}
		 ?>
	</div>
</body>
</html>